String.prototype.trim = function()
{
	return this.replace(/(^[\s]*)|([\s]*$)/g, "");
}

String.prototype.len = function()
{
    return this.replace(/[^\x00-\xff]/g,"**").length;
}




function getHttpRequest(){
	var httpRequest;
	if (window.XMLHttpRequest){ // Mozilla, Safari,...
		httpRequest = new XMLHttpRequest();
		if (httpRequest.overrideMimeType){
			httpRequest.overrideMimeType('text/xml');
		}
	}
	else if (window.ActiveXObject){ // IE
		try{
			httpRequest = new ActiveXObject("Msxml2.XMLHTTP");
		}
		catch(e){
			try {
				httpRequest = new ActiveXObject("Microsoft.XMLHTTP");
			} 
			catch(e){}
		}
	}
	return httpRequest;
}



function goNavTab(cat){
    var list;
    list = document.getElementsByTagName("li");
    for(var i=0; i<list.length; i++){
        if(list[i].id.indexOf("navItem_") == 0){
            if(list[i].id == "navItem_" + cat)
                list[i].className = "hot";
            else
                list[i].className = "";
        }
    }
    
    list = document.getElementsByTagName("ul");
    for(var i=0; i<list.length; i++){
        if(list[i].id.indexOf("navSubItem_") == 0){
            if(list[i].id == "navSubItem_" + cat)
                list[i].className = "";
            else
                list[i].className = "displayNone";
        }
    }
}
function goNavTab2(cat){
    var list;
    list = document.getElementsByTagName("li");
    for(var i=0; i<list.length; i++){
        if(list[i].id.indexOf("navItem2_") == 0){
            if(list[i].id == "navItem2_" + cat)
                list[i].className = "hot";
            else
                list[i].className = "";
        }
    }
    
    list = document.getElementsByTagName("ul");
    for(var i=0; i<list.length; i++){
        if(list[i].id.indexOf("navSubItem2_") == 0){
            if(list[i].id == "navSubItem2_" + cat)
                list[i].className = "";
            else
                list[i].className = "displayNone";
        }
    }
}

function goNavTab4(cat){
    var list;
    list = document.getElementsByTagName("li");
    for(var i=0; i<list.length; i++){
        if(list[i].id.indexOf("navItem4_") == 0){
            if(list[i].id == "navItem4_" + cat)
                list[i].className = "hot";
            else
                list[i].className = "";
        }
    }
    
    list = document.getElementsByTagName("ul");
    for(var i=0; i<list.length; i++){
        if(list[i].id.indexOf("navSubItem4_") == 0){
            if(list[i].id == "navSubItem4_" + cat)
                list[i].className = "";
            else
                list[i].className = "displayNone";
        }
    }
}
function goNavTab5(cat){
    var list;
    list = document.getElementsByTagName("li");
    for(var i=0; i<list.length; i++){
        if(list[i].id.indexOf("navItem5_") == 0){
            if(list[i].id == "navItem5_" + cat)
                list[i].className = "hot";
            else
                list[i].className = "";
        }
    }
    
    list = document.getElementsByTagName("ul");
    for(var i=0; i<list.length; i++){
        if(list[i].id.indexOf("navSubItem5_") == 0){
            if(list[i].id == "navSubItem5_" + cat)
                list[i].className = "";
            else
                list[i].className = "displayNone";
        }
    }
}
function goNavTab6(cat){
    var list;
    list = document.getElementsByTagName("li");
    for(var i=0; i<list.length; i++){
        if(list[i].id.indexOf("navItem6_") == 0){
            if(list[i].id == "navItem6_" + cat)
                list[i].className = "hot";
            else
                list[i].className = "";
        }
    }
    
    list = document.getElementsByTagName("ul");
    for(var i=0; i<list.length; i++){
        if(list[i].id.indexOf("navSubItem6_") == 0){
            if(list[i].id == "navSubItem6_" + cat)
                list[i].className = "";
            else
                list[i].className = "displayNone";
        }
    }
}
function goNavTab7(cat){
    var list;
    list = document.getElementsByTagName("li");
    for(var i=0; i<list.length; i++){
        if(list[i].id.indexOf("navItem7_") == 0){
            if(list[i].id == "navItem7_" + cat)
                list[i].className = "hot";
            else
                list[i].className = "";
        }
    }
    
    list = document.getElementsByTagName("ul");
    for(var i=0; i<list.length; i++){
        if(list[i].id.indexOf("navSubItem7_") == 0){
            if(list[i].id == "navSubItem7_" + cat)
                list[i].className = "";
            else
                list[i].className = "displayNone";
        }
    }
}
function goNavTab8(cat){
    var list;
    list = document.getElementsByTagName("li");
    for(var i=0; i<list.length; i++){
        if(list[i].id.indexOf("navItem8_") == 0){
            if(list[i].id == "navItem8_" + cat)
                list[i].className = "hot";
            else
                list[i].className = "";
        }
    }
    
    list = document.getElementsByTagName("ul");
    for(var i=0; i<list.length; i++){
        if(list[i].id.indexOf("navSubItem8_") == 0){
            if(list[i].id == "navSubItem8_" + cat)
                list[i].className = "";
            else
                list[i].className = "displayNone";
        }
    }
}

function goList(regionID, categoryID){
    if(regionID != "000000" && categoryID != "0000"){
	    url = "/" + regionID + "-" + categoryID + "/";
	    window.location = url;
	}
}



